<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04_创建组件语法糖</title>
</head>

<body>
    <div id="app">
        <cpn1></cpn1>
        <cpn2></cpn2>
    </div>
</body>
<script src="../vue.js"></script>
<script>
    //1.创建全局组件语法糖
    Vue.component('cpn1', {
        template: `
                <div>
                    <h3>我是全局组件语法糖标题...</h3>
                    <p>我是全局组件语法糖段落内容...</p>
                </div>
            `
    })


    const vm = new Vue({
        el: '#app',
        components: {
            'cpn2': { //2.创建局部组件语法糖
                template: `
                        <div>
                            <h3>我是局部组件标题2...</h3>
                            <p>我是局部组件段落内容2...</p>
                        </div>
                    `
            }
        }
    })
</script>

</html>